\begin{answer}{bayeslawdisease}
Bayes' law questions are extremely common, both in phone and face-to-face interviews.
The hardest part is turning the words into their respective conditional probabilities.
Start with what you want---the probability that you actually have the disease if your rest results are positive.
Put differently, $P(D_\text{yes}|\text{Test}_+)$, where
$D_\text{yes}$ means you have the disease,
$D_\text{no}$ means you are disease-free,
and
$\text{Test}_+$ or
$\text{Test}_-$ indicates the result of your test.
Using Bayes' law, re-express this as
\begin{align*}
P(D_\text{yes}|\text{Test}_+)
&=
\frac{
  P(
    \text{Test}_+
  |
    D_\text{yes}
  )
  P(
    D_\text{yes}
   )
}
{
  P(
    \text{Test}_+
  |
    D_\text{yes}
  )
  P(
    D_\text{yes}
   )
   +
  P(
    \text{Test}_+
  |
    D_\text{no}
  )
  P(
    D_\text{no}
   )
}
\text{.}
\end{align*}

Now, consider the information the interviewer gave, and hope that you have all the bits you need. (This doesn't always happen, and it can either indicate that you have some more work to do, or that the interviewer got the question wrong.)
``One percent of people in the world have this disease.''
\begin{align*}
  P( D_\text{yes} ) & = 0.01 \\
  P( D_\text{no} ) & = 0.99
  \text{.}
\end{align*}
``The test has an 80\% chance of showing positive if you have the disease,''
\[
  P( \text{Test}_+ | D_\text{yes} ) = 0.8
  \text{,}
\]
``\ldots if you do not have the disease,
there is a 10\% chance of showing a false positive.''
\[
  P( \text{Test}_+ | D_\text{no} ) = 0.1
  \text{.}
\]
Putting it all together yields
\begin{align*}
P(D_\text{yes}|\text{Test}_+)
&= \frac{ (0.8)(0.01) }{ (0.8)(0.01) + (0.1)(0.99)  }
\text{.}
\end{align*}
You need an easy way to evaluate this without a calculator, so factorise it as
\begin{align*}
\frac{ (0.8)(0.01) }{ (0.8)(0.01) + (0.1)(0.99)  }
&= \frac{ (8)(1) }{ (8)(1) + (1)(99)  } \left( \frac{1000}{1000}  \right) \\
&= \frac{8}{107}
\end{align*}
and the denominator is a prime number so you can't simplify further.
Thus, the answer is a bit less than 8\%.
(The exact answer is $0.07476636$.)

You can represent the situation in a picture to get an intuitive understanding.
In the unit square below, the shaded area represents everyone who tested positive for the disease.
The people in the little square on the bottom left (which is 1\% of the square's area) are the ones who actually have the disease.
If you tested positive, you fall in the shaded area.
The question is asking ``given that you fall somewhere in the shaded area, what is the probability that you are also in the little square with people who have the disease.''
\begin{center}

\begin{tikzpicture}[scale=0.08]
\draw (0,0) -- (0,100)     -- (100,100) -- (100,0) -- (0,0);
\draw (0,10) -- (10,10) -- (10, 0);
\filldraw[pattern=crosshatch dots, pattern color=lightgray]
(0,100)     -- (99,100)  --
(99, 90)   -- (0,90) --
(0,100);
\filldraw[pattern=crosshatch dots, pattern color=lightgray]
(0,10)     -- (8,10)  --
(8, 0)   -- (0,0) --
(0,10);
\node at (50,50)  {No Disease};
\node at (0,5) [anchor=east] {Disease};
\end{tikzpicture}

\end{center}
As a fraction, that is
\begin{align*}
\frac{ \text{Small shaded area} }{ \text{Small shaded area}+\text{Large shaded area} }
&= \frac{ (0.8)(0.01) }{ (0.8)(0.01) + (0.1)(0.99)  }
\end{align*}
which is the same as before.
The picture reveals the nuances in Bayes' law questions and the reason for their unintuitive answers.
There is a low prevalence of the disease, together with a high false-positive rate.
Ten percent might not seem high for a false-positive rate, but it results in a large section of the non-diseased population testing positive relative to the few people who actually have the disease.



\end{answer}
